<template>
  <div class="m-item">
    <header class="floortitle">
      <span>猜你喜欢</span>
    </header>
    <div class="like_list">
      <div
        class="content"
        v-for="(item, index) in likeList"
        :key="index"
        @click="goDetail(item.id)"
      >
        <img v-lazy="item.imgUrl" alt="">
        <div class="name">
          <span>{{ item.name }}</span>
        </div>
        <div class="price">
          <span>￥{{ item.price }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    likeList: Array,
  },
  data() {
    return {};
  },
  methods: {
    goDetail(id) {
      this.$router.push({
        path: "/detail",
        query: {
          id,
        },
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.m-item {
  width: 100vw;
  .floortitle {
    position: relative;
    height: 0.7rem;
    text-align: center;
    padding: 0.2rem 0;
    font-size: 0.5rem;
    color: #333333;
    span::before {
      content: "";
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: block;
      background: #d4c0a7;
      top: 50%;
      margin-top: -4px;
      right: 35%;
    }
    span::after {
      content: "";
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: block;
      background: #d4c0a7;
      top: 50%;
      margin-top: -4px;
      left: 35%;
    }
  }
  .like_list {
    padding: 0.1rem;
    display: flex;
    flex-wrap: wrap;
    .content {
      width: 4.9rem;
      height: 6.2267rem;
      box-sizing: border-box;
      padding: 0.1rem;
      margin-bottom: 0.4rem;
      display: flex;
      flex-direction: column;
      img {
        height: 4.7rem;
        width: 4.7rem;
      }
      .name {
        width: 4.7rem;
        height: 0.8267rem;
        box-sizing: border-box;
        padding: 0.2133rem 0;
        span {
          display: inline-block;
	        padding:0 0.16rem;
	        width: 93%;
	        font-size:0.373333rem;
	        font-weight: 400;
	        color:#222;
        	overflow: hidden;
        	text-overflow: ellipsis;
	        white-space: nowrap;
        }
      } 
      .price {
        height: 0.5rem;
        margin-left: -0.1067rem;
        span {
          color: #b0352f;
          font-size: 0.5rem;
          line-height: 0.5rem;
        }
      }
    }
  }
}
</style>